package com.qfmy.model.enums;

/**
 * @author 清风明月
 * @Package com.qfmy.model.enums
 * @date 2025/9/14
 * @description 听书的状态
 */
public enum AudioStatus implements BaseEnum{

    //连载
    SERIALIZING(0, "连载"),
    //完结
    FINISHED(1, "完结"),
    //断更
    BREAKING(2, "断更");

    private Integer code;
    private String message;

    AudioStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getName() {
        return message;
    }

    /**
     * 根据code获取message
     */
    public static String getByCode(Integer code) {
        for (AudioStatus value : values()) {
            if (value.code.equals(code)) {
                return value.message;
            }
        }
        return null;
    }
}
